package org.example;

import org.example.domain.SysUser;
import org.example.service.UserService;
import org.example.service.impl.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest01 {
    @Test
    public void Test01(){
        String config="applicationContext.xml";
        ApplicationContext ctx=new ClassPathXmlApplicationContext(config);
        UserService service= ctx.getBean(UserServiceImpl.class);
        SysUser user=new SysUser();
        user.setAge(20);
        user.setName("小何同学");
        service.addUser(user);
    }
}
